package com.pss.mq.rabbitmq;

import com.pss.common.constant.QueueNameConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Slf4j
@Component
public class SmsListener {

//	@Autowired
//	private VerifyNoMapper verifyNoMapper;

	/**
	 * 短信初始化队列
	 *
	 */
	@RabbitListener(queues = QueueNameConstant.DH_SMS_QUEUE_INIT)
	public void dhSmsInitReceive(List<Map> verifyNoList) {
		log.info("queue2===>>>>start");
		try {
//			for (VerifyNo verifyNo : verifyNoList) {
//				CodeUtils.sendApproveSms(verifyNo);
//				verifyNoMapper.insert(verifyNo);
//			}
			log.info(verifyNoList.toString());
			log.info("queue2===>>>>end");
		} catch (Exception e) {
            log.error(e.getMessage(), e);
		}
	}

}
